//
//  SFCDocumentController.m
//  SVNForCocoa
//
//  Created by Jeremy Pereira on 06/12/2013.
//  Copyright (c) 2013 Jeremy Pereira. All rights reserved.
//

#import "SFCDocumentController.h"
#import "SFCDocument.h"

@implementation SFCDocumentController

-(IBAction) openDocument:(id)sender
{
    [super openDocument:sender];
}

-(void) beginOpenPanel: (NSOpenPanel*) openPanel
              forTypes: (NSArray*) inTypes
     completionHandler: (void (^)(NSInteger)) completionHandler
{
    [openPanel setCanChooseDirectories: YES];
    [openPanel setCanChooseFiles: NO];
    [super beginOpenPanel: openPanel forTypes: inTypes completionHandler: completionHandler];
}

-(id) makeDocumentWithContentsOfURL: (NSURL*) url
                             ofType: (NSString*) typeName
                              error: (NSError*__autoreleasing *) outError
{
    return [[SFCDocument alloc] initWithContentsOfURL: url
                                               ofType: typeName
                                                error: outError];
}

-(id) makeDocumentForURL: (NSURL*) urlOrNil
       withContentsOfURL: (NSURL*) contentsURL
                  ofType: (NSString *)typeName
                   error: (NSError *__autoreleasing*) outError
{
	return [self makeDocumentWithContentsOfURL: contentsURL
                              			ofType: typeName
                               			 error: outError];
}

@end
